package cate.game.power;


import cate.common.table.item.hero.row.HeroBaseRow;
import cate.game.attr.PowerAttrPart;
import cate.game.role.Role;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;


@NoteClass("主角对战力影响因素")
public class RolePowerFactor {

	@NoteField("世界树")
	private WorldTreePowerFactor worldTree;

	@NoteField("图鉴")
	private YokePowerFactor yoke;

	@NoteField("族徽")
	private RaceBadgePowerFactor raceBadge;

	@NoteField("称号")
	private TitlePowerFactor title;

	@NoteField("英雄皮肤")
	private HeroSkinPowerFactor heroSkin;

	@NoteField("协会建设")
	private GuildPowerFactor guildPowerFactor;

	@NoteField("灵契台")
	private MagicContractPowerFactor magic;

	@NoteField("灵界秘藏")
	private HoardPowerFactor hoard;


	public RolePowerFactor(Role role) {
		worldTree = new WorldTreePowerFactor(role);
		yoke = new YokePowerFactor(role);
		raceBadge = new RaceBadgePowerFactor(role);
		title = new TitlePowerFactor(role);
		heroSkin = new HeroSkinPowerFactor(role);
		guildPowerFactor = new GuildPowerFactor(role);
		magic = new MagicContractPowerFactor(role);
		hoard = new HoardPowerFactor(role);
	}

	public PowerAttrPart buildHeroPart(HeroBaseRow row) {
		PowerAttrPart attrPart = new PowerAttrPart();
		attrPart.merge(worldTree.buildHeroPart());
		attrPart.merge(yoke.buildHeroPart());
		attrPart.merge(raceBadge.buildHeroPart(row.camp));
		attrPart.merge(title.buildHeroPart());
		attrPart.merge(heroSkin.buildHeroPart(row.protoId));
		attrPart.merge(guildPowerFactor.buildHeroPart(row.job));
		attrPart.merge(magic.buildHeroPart());
		attrPart.merge(hoard.buildHeroPart());
		return attrPart;
	}
}
